home *** CD-ROM | disk | FTP | other *** search
- --= SID = SIMTEL20 Ada Software Repository Item Description File = SID =--
- -- UNIT NAME : PARSER
- -- VERSION : 1.0
- -- REVIEW CODE :
- -- DDN ADDRESS : RCONN at SIMTEL20
- -- AUTHOR : Richard Conn
- -- : Texas Instruments, Ada Technology Branch
- -- : PO Box 801, MS 8007
- -- : McKinney, TX 75069
- -- COPYRIGHT :
- -- DATE CREATED : 21 July 85
- -- DATE RELEASED : 30 July 85
- -- DATE LAST UPDATED : 30 July 85
- -- LOCATION : C2MUG
- -- LOCATION : ASR
- -- ENVIRONMENT : DG MV10000 (ROLM ADE) and
- --= CLASSIFICATION ===============================================--
- -- CATEGORY LEVEL 1 : COMPONENTS
- -- CATEGORY LEVEL 2 : Parser
- -- CATEGORY LEVEL 3 :
- -- CATEGORY LEVEL 4 :
- -- KEYWORD : parser
- -- KEYWORD : generic parser
- -- KEYWORD : UNIX
- -- KEYWORD : ARGC
- -- KEYWORD : ARGV
- -- INDEX : Parser
- -- INDEX : Generic Parser
- -- INDEX : Parser, Generic
- -- INDEX : ARGC/ARGV
- -- TAXONOMY :
- -- DEPENDENCIES :
- -- SEE ALSO :
- --= FILE LISTING ===============================================--
- -- FILE SPECS : PD:<ADA.COMPONENTS>PARSER.*
- -- DIRECTORY DISPLAY :
- -- Directory PD:<ADA.COMPONENTS>
- -- File Name Byte Count Line Count
- -- --------------- ---------- ----------
- -- PARSER.PRO 4258 84
- -- PARSER.SRC 11086 274
- -- =============== ========== ==========
- -- 2 Files 15344 358
- --= ABSTRACT ===============================================--
- -- PARSER is a generic parser that functions in a manner similar
- -- to the ARGC/ARGV parser of UNIX. It contains one procedure, PARSE,
- -- which accepts a string as input and returns ARGC, a count of the
- -- number of tokens in the string, and ARGV, a vector of strings, each
- -- string containing a token.
- --
- -- PARSER is instantiated with two strings (DEL for DELIMITER and
- -- DEL_TOKEN for DELIMITER_TOKEN). The DEL string is composed of
- -- characters which delimit each token (and are not a part of the token).
- -- All characters less than space are automatically delimiters, and the
- -- DEL string should contain at least one character (such as a space).
- -- DEL_TOKEN is a string composed of characters which delimit tokens and
- -- which are tokens themselves. If "=" is a DEL_TOKEN, for example, then
- -- "CAT= DOG" is composed of three tokens, "CAT", "=", and "DOG", where
- -- if "=" is a DEL, then "CAT= DOG" is composed of two tokens, "CAT" and
- -- "DOG". This assumes that the space character is a DEL.
- --
- -- PARSER may also be instantiated with ARGC_LIMIT, which
- -- indicates the maximum number of tokens allowed. If this limit is
- -- exceeded, then the last ARGV token contains the remainder of the
- -- string. The default value of ARGC_LIMIT is 20.
- --
- -- ARG_STRING_LENGTH is the last instantiation option for PARSER.
- -- It indicates the maximum length of an ARGV string, and it defaults to
- -- 80.
- --= REVISION HISTORY ===============================================--
- --
- -- DATE VERSION AUTHOR HISTORY
- -- 19850730 1.0 Richard Conn Initial Release
- --= RELEASE NOTICE ===============================================--
- -- This prologue must be included in all copies of this software.
- --
- -- This software is released to the Ada community.
- -- This software is released to the Public Domain (note:
- -- software released to the Public Domain is not subject
- -- to copyright protection).
- -- Restrictions on use or distribution: NONE
- --= DISCLAIMER ===============================================--
- -- This software and its documentation are provided "AS IS" and
- -- without any expressed or implied warranties whatsoever. No warranties
- -- as to performance, merchantability, or fitness for a particular
- -- purpose exist.
- -- The user is advised to test the software thoroughly before
- -- relying on it. The user must assume the entire risk and liability of
- -- using this software. In no event shall any person or organization of
- -- people be held responsible for any direct, indirect, consequential or
- -- inconsequential damages or lost profits.
- --======================================================================--
-